package com.qingjiang.projectschedule.controller;

import com.qingjiang.projectschedule.service.ManageDeptService;
import com.qingjiang.projectschedule.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("manage")
@CrossOrigin
public class ManageDeptController {
    @Autowired
    private ManageDeptService manageDeptService;

    @GetMapping("getAllManageList")
    public Result getAllManageList(){
        return manageDeptService.getAllManageList();
    }

    @PostMapping("addLeaderConfig")
    public Result addLeaderConfig(@RequestParam("uid") Integer uid,@RequestParam("deptId") Integer deptId){
        System.out.println("uid:"+uid);
        return manageDeptService.addLeaderConfig(uid,deptId);
    }

    @PostMapping("deleteLeaderConfig")
    public Result deleteLeaderConfig(@RequestParam("uid") Integer uid,@RequestParam("deptId") Integer deptId){
        return manageDeptService.deleteLeaderConfig(uid,deptId);
    }
}
